package com.yzt;

public class StringContact {
    public static void main(String[] args) {
        String str1 = "[";

        int[] arr1 = {10,20,30,};
        for (int i = 0; i < arr1.length; i++) {
            int i1 = arr1[i];
            String str2 = i1 + "";
            if (i == 0) {
                str1 = str1.concat(str2 + ",");
            } else if (i != arr1.length - 1) {
                str1 = str1.concat(str2 + ",");
            } else {
                str1 = str1.concat(str2 + "]");
            }
        }
        System.out.println(str1);

    }
}
